@import url('https://fonts.googleapis.com/css?family=Anton');

input[type='number'] {
    -moz-appearance: textfield;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

html {
    height: 100%;
    font-size: 0;
    font-family: 'Source Sans Pro', sans-serif;
    color: white;
    background: #272B30 url('/background.png') repeat;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

body {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
}

table, th, td {
    border: none;
    border-collapse: collapse;
    padding: 0;
}

body.lobbying #lobby {
    display: block;
}

body.playing {
    overflow: hidden;
}

body.playing #title {
    height: 50px;
}

body.playing #game {
    display: block;
}

#title {
    display: block;
    height: 137px;
    margin: 40px auto 20px;
    transition: height 200ms;
}

#main {
    flex: 1;
    position: relative;
}

#lobby {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 700px;
    height: 90%;
    max-height: 494px;
    transform: translate(-50%, -50%);
}

#lobby > .tab {
    display: inline-block;
}

#lobby > .tab > .input {
    display: none;
}

#lobby > .tab > .label {
    display: inline-block;
    height: 28px;
    margin: 0 2px;
    padding: 0 16px;
    font: 16px 'Anton';
    line-height: 28px;
    letter-spacing: 2px;
    border-radius: 3px 3px 0 0;
    vertical-align: middle;
    cursor: pointer;
    transform: translate(14px, -21px) skewX(-15deg);
    transition: transform 125ms;
}

#lobby > .tab > .label::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

#lobby > .tab > .label:hover {
    transform: translate(15px, -24px) skewX(-15deg);
}

#lobby > .tab > .input:checked + .label {
    transform: translate(16px, -28px) skewX(-15deg);
}

#lobby > .tab > .input:disabled + .label {
    cursor: not-allowed;
}

#lobby > .tab > .input:not(:checked) ~ .content {
    display: none;
}

#lobby > .tab > .content {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    background-color: #131313;
    border: 3px solid #555;
    border-radius: 6px;
    overflow-y: auto;
    z-index: 1;
}

#lobby > .games > .label {
    background-color: #FF1E19;
}

#lobby > .games > .label::before {
    background-image: url();
    transform: translateY(-3px);
}

#lobby > .create > .label {
    background-color: green;
}

#lobby > .create > .label::before {
    background-image: url();
    transform: translateY(-1px);
}

#lobby > .rules > .label {
    background-color: purple;
}

#lobby > .rules > .label::before {
    background-image: url();
    transform: translateY(-1px);
}

#lobby > .games > .content {
    padding: 8px;
}

#lobby > .games > .content:empty {
    cursor: pointer;
}

#lobby > .games > .content:empty::before {
    content: 'Create a game to begin...';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    text-underline-offset: 3px;
    text-decoration-color: darkgray;
    opacity: 0.2;
    color: darkgray;
    transform: translate(-50%, -50%);
}

#lobby > .games > .content:empty:hover::before {
    text-decoration: underline;
}

#lobby > .games > .content > .game {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
    padding: 8px;
    font-size: 16px;
    background-color: #272B30;
    border-radius: 3px;
    cursor: pointer;
    transition: opacity 250ms;
}

#lobby > .games > .content > .game:hover {
    background-color: #383e44;
}

#lobby > .games > .content > .game > .name {
    flex: 1;
    font-size: 16px;
    font-weight: bold;
}

#lobby > .games > .content > .game > .separator {
    width: 1px;
    margin: 4px 10px;
    background-color: white;
}

#lobby > .games > .content > .game > .icon::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center;
    transform: translateY(-2px);
}

#lobby > .games > .content > .game > .size::after {
    background-image: url();
    transform: scale(0.9) translateY(-2px);
}

#lobby > .games > .content > .game > .speed::after {
    background-image: url();
}

#lobby > .games > .content > .game > .players::after {
    width: 20px;
    background-image: url();
}

#lobby > .games > .content > .game > .join {
    width: 18px;
    height: 18px;
    background-image: url();
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
}

#lobby > .create > .content {
    padding: 12px;
    line-height: 1;
}

#lobby > .create > .content > .settings > .section:nth-last-child(n+2) {
    margin-bottom: 16px;
}

#lobby > .create > .content > .settings > .section > .title {
    margin-bottom: 8px;
    font-size: 20px;
    font-weight: bold;
}

#lobby > .create > .content > .settings > .section > .spacing {
    margin-top: 12px;
}

#lobby > .create > .content > .settings .input.hidden {
    display: none !important;
}

#lobby > .create > .content > .settings .input > .label {
    margin-bottom: 2px;
    font-size: 12px;
    color: lightgray;
}

#lobby > .create > .content > .settings .input > input:valid {
    border-color: green !important;
}

#lobby > .create > .content > .settings .input.text > input {
    width: 100%;
    padding: 8px 12px;
    background-color: #272B30;
    color: white;
    border: 1px solid black;
    border-radius: 3px;
    font-size: 12px;
}

#lobby > .create > .content > .settings .input.number {
    display: inline-block;
    margin: 0 16px 4px 0;
}

#lobby > .create > .content > .settings .input.number > .label {
    font-weight: bold;
}

#lobby > .create > .content > .settings .input.number > .label[title] {
    cursor: help;
}

#lobby > .create > .content > .settings .input.number > input {
    width: 140px;
    padding: 8px 12px;
    background-color: #272B30;
    color: white;
    border: 1px solid black;
    border-radius: 3px;
    font-size: 12px;
}

#lobby > .create > .content > .settings .input.checkbox {
    display: inline-block;
    margin: 0 20px 8px 0;
}

#lobby > .create > .content > .settings .input.checkbox > .label {
    display: inline-block;
    cursor: pointer;
}

#lobby > .create > .content > .settings .input.checkbox > input {
    margin-right: 6px;
    cursor: pointer;
}

#lobby > .create > .content > .actions {
    position: absolute;
    right: 12px;
    bottom: 12px;
}

#lobby > .create > .content > .actions > .process {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: bold;
    background: rgb(29, 130, 29);
    border-radius: 3px;
    cursor: pointer;
    transition: opacity 125ms;
}

#lobby > .create > .content > .actions > .process::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 4px;
    background-image: url();
    background-repeat: no-repeat;
    background-position: center;
}

#lobby > .create > .content > .actions > .process:hover {
    opacity: 0.95;
}

#lobby > .create > .content > .actions > .process:active {
    opacity: 0.8;
}

#lobby > .create > .content > .actions > .process.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

#lobby > .rules > .content {
    padding: 12px;
    line-height: 1;
}

#lobby > .rules > .content > .section:nth-last-child(n+2) {
    margin-bottom: 20px;
}

#lobby > .rules > .content > .section > .title {
    margin-bottom: 8px;
    font-size: 20px;
    font-weight: bold;
    color: white;
}

#lobby > .rules > .content > .section > .text {
    font-size: 14px;
    font-weight: bold;
    color: lightgray;
    line-height: 1.6em;
}

#lobby > .rules > .content > .section > .text > .paragraph:nth-last-child(n+2) {
    margin-bottom: 10px;
}

#lobby > .rules > .content .key-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#lobby > .rules > .content .key {
    display: inline-flex;
    width: 18px;
    height: 18px;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: white;
    background-color: gray;
    border: 1px solid white;
    border-radius: 2px;
    box-shadow: 1px 1px 1px lightblue;
    transform: translateY(-1px);
}

#lobby > .rules > .content > .section > .perk {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
    color: lightgray;
}

#lobby > .rules > .content > .section > .perk > .color {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    vertical-align: middle;
}

#lobby > .rules > .content > .section > .perk > .info {
    display: inline-block;
    font-size: 14px;
    font-weight: bold;
    color: lightgray;
    vertical-align: middle;
}

#game {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#game > .header {
    display: flex;
    align-items: flex-end;
    padding: 0 0 4px 8px;
}

#game > .header > .title {
    flex: 1;
    font-size: 22px;
    font-weight: bold;
    text-align: left;
}

#game > .header > .actions > .action {
    display: inline-flex;
    align-items: center;
    margin: 0 2px 0 4px;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 3px;
    vertical-align: middle;
    cursor: pointer;
    transition: opacity 125ms;
}

#game > .header > .actions > .action:hover {
    opacity: 0.95;
}

#game > .header > .actions > .action:active {
    opacity: 0.8;
}

#game > .header > .actions > .action::after {
    background-repeat: no-repeat;
}

#game > .header > .actions > .leave {
    background-color: rgb(228, 149, 0);
}

#game > .header > .actions > .leave::after {
    content: '';
    width: 14px;
    height: 18px;
    margin-left: 6px;
    background-image: url();
}

#game > .header > .actions > .change-color.hidden {
    display: none;
}

#game > .header > .actions > .change-color::after {
    content: '';
    width: 18px;
    height: 18px;
    background-image: url();
    transform: translate(2px, -1px);
}

#game > canvas {
    background-color: rgba(0, 0, 0, 0.5);
}